﻿namespace CV.Dal.Mongo.Tools
{
    using CV.Interfaces.Tools;
    using MongoDB.Driver;
    using System.Configuration;

    public class CVMongoClient
    {
        private MongoClient client;
        internal IConfigurationWrapper ConfigurationWrapper { get; private set; }

        public CVMongoClient(IConfigurationWrapper configurationWrapper)
        {
            this.ConfigurationWrapper = configurationWrapper;

            var connectionString = configurationWrapper.ConnectionStrings["MongoDB"].ConnectionString;
            client = new MongoClient(connectionString);
        }

        public MongoClientSettings Settings
        {
            get { return client.Settings; }
        }

        public MongoServer GetServer()
        {
            return client.GetServer();
        }
    }
}
